import React, { Component } from "react";
/* 
  两种路由模式之间的区别
  1. BrowserRouter  H5 history 模式 http://localhost/home
    a.1. window.pushState
  2.HashRouter hash 路由模式  http://localhost/#/home
    b.1 window.addEventListener("hashchange",fn)

  3. MemoryRouter 路由是在内存中 
*/
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
// import { HashRouter as Router, Route, Link } from "react-router-dom";
// import { MemoryRouter as Router, Route, Link } from "react-router-dom";
function Home(){
  return <div>
    <h1>主页内容</h1>
  </div>
}
export default class App extends Component {
  render() {
    return <Router>
      <Link to="/Home">主页</Link>
      <Route path="/" component={Home}></Route>
      <Route path="/Home" component={Home}></Route>
    </Router>;
  }
}
